<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content>
    <meta name="keyword" content>
    <link rel="shortcut icon" href="/myblog/img/favicon.ico">

    <title>
        
          Ethan的博客 | Ethan&#39;s Blog
        
    </title>

    <link rel="canonical" href="http://reflectyi.gitee.io/myblog/myblog/page/2/">

    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/myblog/css/bootstrap.min.css">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/myblog/css/hux-blog.min.css">

    <!-- Pygments Highlight CSS -->
    <link rel="stylesheet" href="/myblog/css/highlight.css">

    <!-- Custom Fonts -->
    <!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
    <!-- Hux change font-awesome CDN to qiniu -->
    <link href="https://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">


    <!-- Hux Delete, sad but pending in China
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
    css'>
    -->


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- ga & ba script hoook -->
    <script></script>
</head>


<!-- hack iOS CSS :active style -->
<body ontouchstart="">

    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/myblog/">Hi,Ethan</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <!-- Known Issue, found by Hux:
            <nav>'s height woule be hold on by its content.
            so, when navbar scale out, the <nav> will cover tags.
            also mask any touch event of tags, unfortunately.
        -->
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/myblog/">首页</a>
                    </li>

                    

                        
                    

                        
                        <li>
                            <a href="/myblog/about/">目录</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/myblog/archives/">时间轴</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/myblog/tags/">标签</a>
                        </li>
                        
                    
                    
                </ul>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
<script>
    // Drop Bootstarp low-performance Navbar
    // Use customize navbar with high-quality material design animation
    // in high-perf jank-free CSS3 implementation
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        // CLOSE
            $navbar.className = " ";
            // wait until animation end.
            setTimeout(function(){
                // prevent frequently toggle
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        // OPEN
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>


    <!-- Main Content -->
    <!-- Page Header -->
<header class="intro-header" style="background-image: url('/myblog/img/home-bg.jpg')">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
                <div class="site-heading">
                    <h1>Hi,Ethan</h1>
                    <!--<hr class="small">-->
                    <span class="subheading">Welcome back!</span>
                </div>
            </div>
        </div>
    </div>
</header>



<!-- Main Content -->
<div class="container">
    <div class="row">
        

<!-- USE SIDEBAR -->
    <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-1
                col-md-8 col-md-offset-1
                col-sm-12
                col-xs-12
                post-container
            ">
            
                <!-- Main Content -->


<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/GC收集器7种/">
        <h2 class="post-title">
            jvm GC收集器
        </h2>
        <h3 class="post-subtitle">
            jvm 中常用GC收集器，回收方式
        </h3>
        <div class="post-content-preview">
            GC收集器概述
新生代(young generation)：

Serial
ParNew
Parallel Scavenge 


老年代(Tenured generation)

Serial Old
Parallel Old
CMS


全部适用
G1 


没有最好的收集器，要根据实际情况进行相应的选择1、serial收集器
特点：
复制算法  
单线程收集器，暂停所有工作线程(St......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/jvm执行/class加载过程/">
        <h2 class="post-title">
            class加载过程
        </h2>
        <h3 class="post-subtitle">
            详解class生命周期各阶段作用
        </h3>
        <div class="post-content-preview">
            class加载过程
详细介绍class的生命周期，及其作用
一、加载阶段
通过class的全限定名(包名+类名)，读取二进制流(从本地，网络，jar，zip，jsp等等)

将class文件中的static存储结构转换为方法区的运行时数据结构
内存中生成一个java.lang.Class对象，作为方法区这个类内容的访问入口(hotSpot是放在方法区)
非数组class加载：
准确的说，是加......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/JVM回收算法概述/">
        <h2 class="post-title">
            JVM回收算法概述
        </h2>
        <h3 class="post-subtitle">
            4种回收算法简洁及其优缺点
        </h3>
        <div class="post-content-preview">
            ##JVM回收算法概述

概要：主要针对垃圾算法回收基础描述，奠定了后续serial、parNew、parallel scavenge、CMS、G1、serial Old、parallel Old算法基础

标记-清除算法(cms)
复制算法
标记-整理算法(serial、parNew)
分代收集算法 一、标记-清除算法(Mark-sweep)


Node：后续的收集算法都是基于标记-清除......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/堆-内存分配和回收策略/">
        <h2 class="post-title">
            Heap中Obj分配策略和回收策略
        </h2>
        <h3 class="post-subtitle">
            jvm runtime运行时，堆内存分配优先级
        </h3>
        <div class="post-content-preview">
            内存分配和回收策略
java内存自动管理：obj内存分配、obj内存回收一、内存分配1、优先在Eden空间分配
当Eden空间不足时，触发一次Minor GC
这时新生代中，两个survivor一个是上一次是存活对象，一个是下一次要预留的复制空间
新生代GC(Minor GC)：新生代obj生命很短Minor GC很频繁，速度很快
老年代GC(Major GC)：老年代obj生命很长，比新生......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/堆-对象创建-及其形态/">
        <h2 class="post-title">
            Heap对象
        </h2>
        <h3 class="post-subtitle">
            hotspot jvm对象创建
        </h3>
        <div class="post-content-preview">
            hotspot虚拟机对象一、对象的创建
概要：主要讨论堆中对象的创建，但是不包括数组和类对象。1、New指令发生了什么？
首先检测方法区常量池中，有没有class相关的引用，该class有没有加载相关的信息（被加载、解析、初始化）。如果没有加载，那么就加载class相关信息。
1）、分配内存
class加载完成后，会为为对象在新生代中，分配内存，分配内存根据GC回收算法不同采用的分配方式也不......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/浅谈对象死亡-死亡判定(标记)/">
        <h2 class="post-title">
            浅谈对象死亡
        </h2>
        <h3 class="post-subtitle">
            jvm runtime运行时，堆中Obj死亡，基本回收算法
        </h3>
        <div class="post-content-preview">
            浅谈对象死亡一、概述
每个栈帧的分配多少内存，在class结构确定下来的时候就已经确定大小。
java堆，只有在运行时才能确定其大小。二、引用计数算法
概述：实现简单，判定效率高。采用该算法的python，AS。同时，因为引用计数算法无法解决对象的循环引用问题，所以jvm并没有采用。
给对象添加一个引用计数器，每当有一个地方引用该对象，计数器就+1，每当引用失效就-1，一直减到0三、可达性分......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/memory/运行时数据区-内存结构/">
        <h2 class="post-title">
            jvm运行时数据区内存概述
        </h2>
        <h3 class="post-subtitle">
            简要概述runtime内存结构，及其作用
        </h3>
        <div class="post-content-preview">
            内存概述
概要：通常情况，jvm规范把内存分成了，程序计数器、堆栈、堆、方法区。1、程序计数器
前置知识
在单核单线程cpu的情况下：
1、cpu调度，最小执行单元是线程， 进程是资源分配的最小单元。
2、cpu把一小段时间，分成N个时间片段，然后调度线程，也就造成了在瞬时情况下，只有一个线程执行。    


多核cpu
1、多核cpu在执行多任务时，并不是固定执行某个任务，而是根据进程中......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/并发/java与线程/">
        <h2 class="post-title">
            java与线程
        </h2>
        <h3 class="post-subtitle">
            线程的实现、调度、切换
        </h3>
        <div class="post-content-preview">
            java与线程一、线程的实现
概述：线程可以把一个进程的调度和资源分配分开。
线程既可以共享进程内存(内存地址、文件IO等)，又可以独立调度(CPU的最小调度单元)
线程的实现有三种方式：内核线程实现、用户线程实现、用户线程和轻量级进程混合实现


1、内核线程实现
由操作系统内核实现的线程，线程切换通过内核调度器对线程进行调度，并负责将线程的任务映射到各个处理器上。
每个内核线程可以看做是......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/并发/线程安全/">
        <h2 class="post-title">
            java线程安全
        </h2>
        <h3 class="post-subtitle">
            线程安全的几种情况和实现方法
        </h3>
        <div class="post-content-preview">
            线程安全
概述：代码本身封装了所有的正确性保障手段。另调用者无须关心多线程的问题，也无须采取任何措施来保证多线程的正确调用。一、java中的线程安全
概述：线程安全由强到弱排序，共享数据分为五类
不可变
绝对线程安全
相对线程安全
线程兼容性
线程对立 


1、不可变
不可变对象一定是线程安全的，无论方法的实现和调用者，都不需要在采取任何的安全措施。
只要一个不可变对象被正确构建出来，那么......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/myblog/2016/10/01/jvm/并发/java内存模型/">
        <h2 class="post-title">
            java内存模型
        </h2>
        <h3 class="post-subtitle">
            主内存和工作内存、volatile
        </h3>
        <div class="post-content-preview">
            java内存模型
jvm规范定义一种java内存模型(JMM)来屏蔽掉各种硬件和操作系统的内存访问差异。以实现让java程序在不同平台下都能达到一致的内存访问效果。一、主内存和工作内存
概述：java内存模型的主要目标，是定义程序中各个变量的访问规则 
即在jvm中将变量存储到内存和从内存中读取变量的底层细节
这里的变量不包括虚拟机栈和方法参数。


1、主内存：
所有线程的公共内存 
所有......
        </div>
    </a>
    <p class="post-meta">
        Posted by Ethan on
        2016-10-01
    </p>

</div>
<hr>



<!-- Pager -->

<ul class="pager">
    
        <li class="previous">
            <a href="/myblog/">&larr; Newer Posts</a>
        </li>
    
    
        <li class="next">
            <a href="/myblog/page/3/">Older Posts &rarr;</a>
        </li>
    
</ul>



                <!-- 如果开启评论功能 -->
                

            </div>
    <!-- Sidebar Container -->
            <div class="
                col-lg-3 col-lg-offset-0
                col-md-3 col-md-offset-0
                col-sm-12
                col-xs-12
                sidebar-container
            ">
                <!-- Featured Tags -->
                
                <section>
                    <!-- no hr -->
                    <h5><a href="/myblog/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                        
                            
                            <a href="/myblog/tags/#HTTP" title="HTTP" rel="4">HTTP</a>
                            
                        
                            
                            <a href="/myblog/tags/#jvm" title="jvm" rel="18">jvm</a>
                            
                        
                            
                            <a href="/myblog/tags/#class" title="class" rel="5">class</a>
                            
                        
                            
                            <a href="/myblog/tags/#jvm run-time" title="jvm run-time" rel="2">jvm run-time</a>
                            
                        
                            
                            <a href="/myblog/tags/#GC" title="GC" rel="3">GC</a>
                            
                        
                            
                            <a href="/myblog/tags/#Memory" title="Memory" rel="4">Memory</a>
                            
                        
                            
                            <a href="/myblog/tags/#Thread" title="Thread" rel="4">Thread</a>
                            
                        
                    </div>
                </section>
                

                <!-- Short About -->
                <section class="visible-md visible-lg">
                    <hr><h5><a href="/myblog/about/">ABOUT ME</a></h5>
                    <div class="short-about">

                        
                            <img src="/myblog//img/avatar.jpg" />
                        

                        
                            <p>我要成为魔法师!</p>
                        

                        <!-- SNS Link -->
                        <ul class="list-inline">
                            
                            
                            

                            

                            
                                <li>
                                    <a target="_blank" href="https://www.facebook.com/stateInstance">
                                        <span class="fa-stack fa-lg">
                                            <i class="fa fa-circle fa-stack-2x"></i>
                                            <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
                                        </span>
                                    </a>
                                </li>
                            

                            
                                <li>
                                    <a target="_blank"  href="https://github.com/stateInstance">
                                        <span class="fa-stack fa-lg">
                                            <i class="fa fa-circle fa-stack-2x"></i>
                                            <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                                        </span>
                                    </a>
                                </li>
                            
                            
                            
                            
                        </ul>
                    </div>
                </section>
                
                <!-- Friends Blog -->
                
                <hr>
                <h5>FRIENDS</h5>
                <ul class="list-inline">

                    
                        <li><a href="http://blog.kaijun.rocks" target="_blank">Kaijun&#39;s Blog</a></li>
                    
                        <li><a href="http://huangxuan.me" target="_blank">Hux Blog</a></li>
                    
                        <li><a href="#" target="_blank">Foo</a></li>
                    
                        <li><a href="#" target="_blank">Bar</a></li>
                    
                        <li><a href="#" target="_blank">Example Friends</a></li>
                    
                        <li><a href="#" target="_blank">It helps SEO</a></li>
                    
                </ul>
                
            </div>
        
    </div>
</div>


    <!-- Footer -->
    <!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                
                
                

                

                
                    <li>
                        <a target="_blank" href="https://www.facebook.com/stateInstance">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                
                    <li>
                        <a target="_blank"  href="https://github.com/stateInstance">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                </ul>
                <p class="copyright text-muted">
                    Copyright &copy; Hi,Ethan 2019 
                    <br>
                    Theme by <a href="http://huangxuan.me">Hux</a> 
                    <span style="display: inline-block; margin: 0 5px;">
                        <i class="fa fa-heart"></i>
                    </span> 
                    Ported by <a href="http://blog.kaijun.rocks">Kaijun</a> | 
                    <iframe
                        style="margin-left: 2px; margin-bottom:-5px;"
                        frameborder="0" scrolling="0" width="91px" height="20px"
                        src="https://ghbtns.com/github-btn.html?user=kaijun&repo=hexo-theme-huxblog&type=star&count=true" >
                    </iframe>
                </p>
            </div>
        </div>
    </div>
</footer>

<!-- jQuery -->
<script src="/myblog/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="/myblog/js/bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="/myblog/js/hux-blog.min.js"></script>


<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>

<!-- 
     Because of the native support for backtick-style fenced code blocks 
     right within the Markdown is landed in Github Pages, 
     From V1.6, There is no need for Highlight.js, 
     so Huxblog drops it officially.

     - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0  
     - https://help.github.com/articles/creating-and-highlighting-code-blocks/    
-->
<!--
    <script>
        async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
            hljs.initHighlightingOnLoad();
        })
    </script>
    <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->


<!-- jquery.tagcloud.js -->
<script>
    // only load tagcloud.js in tag.html
    if($('#tag_cloud').length !== 0){
        async("http://reflectyi.gitee.io/myblog/myblog/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                //size: {start: 1, end: 1, unit: 'em'},
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>

<!--fastClick.js -->
<script>
    async("https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>


<!-- Google Analytics -->


<script>
    // dynamic User by Hux
    var _gaId = 'UA-49627206-1';
    var _gaDomain = 'huangxuan.me';

    // Originial
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', _gaId, _gaDomain);
    ga('send', 'pageview');
</script>




<!-- Baidu Tongji -->

<script>
    // dynamic User by Hux
    var _baId = '4cc1f2d8f3067386cc5cdb626a202900';

    // Originial
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?" + _baId;
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
</script>


<!-- Side Catalog -->





<!-- Image to hack wechat -->
<img src="http://reflectyi.gitee.io/myblog/myblog/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->

</body>

</html>
